// home_5
//test_calculating
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<ctime>

void test_val(int,int); // function displays test result

int main()
{
	int number1=0;
	int number2=0;
	int result=0;
	int res=0;
	int t_count=0;
	int f_count=0;
	

	std::cout<< "Welcome in test calculating: " << std::endl;
	std::cout<< "Exit: -1 " << std::endl;
	std::srand(std::time(0));
	
	do
	{
		number1 = ( 1 + rand() % 10 );
		number2 = ( 1 + rand() % 10 );

		std::cout<< "\t" << number1 << "x" << number2 << "=";
		std::cin>> res;

		 if(number1*number2==res)
		{
		++t_count;
		}
		else
		{
		++f_count;
		}
	} while(res!=-1);

	test_val(t_count,f_count);
	
	return 0;
}

void test_val(int t_val,int f_val)
{
int val = (10 * t_val / ( t_val + f_val ));

std::cout<< "Your test result is:" << std::endl;

switch(val)
{
	case 10:
	case 9:
	case 8:
		std::cout << "Exeland" << std::endl;
		break;
	case 7:
	case 6:
	case 5:
	case 4:
		std::cout << "Good" << std::endl;
	break;
	case 3:
	case 2:
	case 1:
	case 0:
		std::cout << "Bad" << std::endl;
		break;
	default:
		std::cerr << "Error!!!" << std::endl;
		break;
}
}